package com.cloud.code.算法.递归;

public class Test {

    public static void main(String[] args) {
        int [] arr = {1,2,4,5};

        System.out.println(sum(arr,0));
    }


    public static int sum(int[] arr, int l){
        if (arr.length == l)
            return 0;
        return arr[l]+sum(arr,l+1);
    }
}
